#ifndef CONSTANT_H
#define CONSTANT_H

/*!
 * \file      constant.h
 * \brief     Constants of the project.
 * \author    Duriez Franck
 * \author    Carton Paul-Henri
 * \version   0.1
 */

#define OUTLINE       15.f
                           ///< General outline size
#define OUTLINE_COLOR sf::Color::Color(125, 125, 125, 125)
                           ///< General outline color
#define SPACE_GRP     15.f
                           ///< Space between graphic parts \relates TetrisWidget
#define GLOBAL_BACKGROUND_IMAGE "data/global_background.png"
                           ///< \relates TetrisWidget
#define DEBUG_LOG_FILE "tetris.log"

/********
 * GRID *
 ********/

/*{{{*/
	#define GRID_HEIGHT   22
	                            ///< Height of the Grid in Squares \relates Grid
	#define GRID_WIDTH    12
	                            ///< Width of the Grid in Squares  \relates Grid
	#define GRID_WIDTH_f  (GRID_WIDTH  * SQUARE_SIZE)
	                            ///< Height of the Grid in pixels \relates Grid
	#define GRID_HEIGHT_f (GRID_HEIGHT * SQUARE_SIZE)
	                            ///< Width of the Grid in pixels  \relates Grid
	#define GRID_POS_X    300.f
	                            ///< X Position of the Grid \relates Grid
	#define GRID_POS_Y    15.f
	                            ///< Y Position of the Grid \relates Grid
	#define GRID_BACKGROUND_COLOR sf::Color::Color(000, 000, 000, 175)
	                            ///< \relates Grid
/*}}}*/

/*********
 * SCORE *
 *********/

/*{{{*/
	#define LEVEL_UP                  5000.f
	                                          ///< Point per level
	#define PTS_PER_SEC               500.f
	                                          ///< Score raising per square and unit of time \relates ScoreManager
	#define SCORE_BACKGROUND_POS_X    SPACE_GRP
	                                          ///< X Score displayer background position \relates ScoreManager
	#define SCORE_BACKGROUND_POS_Y    SPACE_GRP
	                                          ///< Y Score displayer background position \relates ScoreManager
	#define SCORE_BACKGROUND_COLOR    sf::Color::Color(150, 150, 0, 125)
	                                          ///< Score displayer background color \relates ScoreManager
	#define SCORE_DISPLAYER_FONT      sf::Font::GetDefaultFont()
	                                          ///< Score displayer font \relates ScoreManager
	#define SCORE_DISPLAYER_FONT_SIZE 30.f
	                                          ///< Score displayer font size \relates ScoreManager
	#define SCORE_DISPLAYER_SIZE_X    (GRID_POS_X - 2*SCORE_BACKGROUND_POS_X - OUTLINE)
	                                          ///< X Size for the score displayer \relates ScoreManager
	#define SCORE_DISPLAYER_SIZE_Y    50.f
	                                          ///< Y Size for the score displayer \relates ScoreManager
	#define SCORE_POS_X               (SCORE_BACKGROUND_POS_X + SCORE_DISPLAYER_FONT_SIZE/2.f)
	                                          ///< X Position of the score displayer \relates ScoreManager
	#define SCORE_POS_Y               (SCORE_BACKGROUND_POS_Y + (SCORE_DISPLAYER_SIZE_Y - SCORE_DISPLAYER_FONT_SIZE)/2.f)
	                                          ///< Y Position of the score displayer \relates ScoreManager
/*}}}*/

/*********
 * SHAPE *
 *********/

/*{{{*/
	#define SHAPE_TYPE_NUMBER    7
	                                    ///< Number of ShapeType \relates Shape
	#define SHAPE_SIZE           4
	                                    ///< Number of side subdivision of Shape \relates Shape
	#define SHAPE_ROTATION_SPEED 100.f
	                                    ///< Rotation speed of Shape \relates Shape
	#define SHAPE_TRANSLAT_SPEED 100.f
	                                    ///< Translation speed of Shape \relates Shape
	#define SHAPE_BACKGROUND_POS_X_NEXT (GRID_POS_X + SQUARE_SIZE * GRID_WIDTH + SPACE_GRP + OUTLINE)
	                                    ///< X Next Shape background position \relates NextShapeManager
	#define SHAPE_BACKGROUND_POS_Y_NEXT SPACE_GRP
	                                    ///< Y Next Shape background position \relates NextShapeManager
	#define SHAPE_POS_X_NEXT     (SHAPE_BACKGROUND_POS_X_NEXT + SQUARE_SIZE)
	                                    ///< X Position of the next Shape \relates NextShapeManager
	#define SHAPE_POS_Y_NEXT     (SHAPE_BACKGROUND_POS_Y_NEXT + SQUARE_SIZE)
	                                    ///< Y Position of the next Shape \relates NextShapeManager
	#define SHAPE_BACKGROUND_COLOR_NEXT sf::Color::Color(60, 120, 30, 125)
	                                    ///< Background color of the next Shape displayer \relates NextShapeManager
	#define SHAPE_BACKGROUND_SIZE_NEXT ((SHAPE_SIZE+2)*SQUARE_SIZE)
	                                    ///< Background size of the next Shape displayer \relates NextShapeManager
	#define SHAPES               int shapes[SHAPE_TYPE_NUMBER][SHAPE_SIZE * SHAPE_SIZE] = { \
	                                    {0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0}, /*I*/ \
	                                    {0,0,0,0,0,1,1,0,0,1,1,0,0,0,0,0}, /*O*/ \
	                                    {0,0,0,0,0,1,1,1,0,0,1,0,0,0,0,0}, /*T*/ \
	                                    {0,1,0,0,0,1,0,0,0,1,1,0,0,0,0,0}, /*L*/ \
	                                    {0,0,1,0,0,0,1,0,0,1,1,0,0,0,0,0}, /*J*/ \
	                                    {0,0,1,0,0,1,1,0,0,1,0,0,0,0,0,0}, /*Z*/ \
	                                    {0,1,0,0,0,1,1,0,0,0,1,0,0,0,0,0}  /*S*/ \
	                                    }
	                                    ///< \relates Shape
/*}}}*/

/**********
 * SQUARE *
 **********/

/*{{{*/
	#define SQUARE_MIN_COLOR 150
	                                         ///< Minimal value for Square color componant \relates CrazyColoredSquare
	#define SQUARE_MAX_CHANGE 10
	                                         ///< Maximal value for Square color componant variation \relates CrazyColoredSquare
	#define SQUARE_SIZE 25.f
	                                         ///< Size of a Square \relates Square
	#define SQUARE_ROTATION_SPEED 400.f
	                                         ///< Rotation speed of a Square on destroy \relates Square
	#define SQUARE_DESTRUCTION_DELAY 0.5
	                                         ///< Destruction delay for a Square \relates Square
	#define SQUARE_IMAGE "data/square_0.png"
	                                         ///< Image for BasicImageSquare \relates BasicImageSquare
/*}}}*/

/**********
 * WINDOW *
 **********/

/*{{{*/
	#define WINDOW_WIDTH  795
	                          ///< \relates MainWindow
	#define WINDOW_HEIGHT 615
	                          ///< \relates MainWindow
/*}}}*/

#endif // CONSTANT_H
